package com.system.service.BookService;

import com.system.dao.BaseDao;
import com.system.dao.BookDao.BookDao;
import com.system.dao.BookDao.BookDaoImpl;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public class BookServiceImpl implements BookService{
    private final BookDao bookDao;
    public BookServiceImpl(){
        bookDao = new BookDaoImpl();
    }

    @Override
    public List<Object> SelectBookList(String BookType, String BookName, String BookAuthor) throws SQLException {
        Connection connection = null;
        List<Object> books = null;
        connection = BaseDao.getConnection();
        books = bookDao.SelectBookList(connection,BookType,BookName,BookAuthor);
        return books;
    }

    @Override
    public List<Object> SelectTypeList() throws SQLException {
        Connection connection = null;
        List<Object> type = null;
        connection = BaseDao.getConnection();
        type = bookDao.SelectTypeList(connection);
        System.out.println("service成功！");
        return type;
    }
}
